$sidebarWidth: 300px;
$sidebarWidthSmall: 44px;

html,
body {
    background: transparent;
}

#settings>.window-base {
    background: var(--page-background);
    background: none;
    color: var(--tray-text);
    font-family: 'Segoe UI Variable Text', 'Segoe UI';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-top: 30px;
    box-sizing: border-box;
    border: 1px solid var(--window-border);
    user-select: none;
    overflow: hidden;
}

#page {
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
    height: 100%;
    background: var(--page-background);
    padding-top: 30px;
    flex: 1;
    max-height: 100vh;
    min-height: 100vh;
    border-top: 30px solid var(--page-background);
    position: relative;
    top: -30px;
}


::-webkit-scrollbar {
    width: 10px;
}

/* Track */
::-webkit-scrollbar-track {}

/* Handle */
::-webkit-scrollbar-thumb {
    background: rgba(122, 122, 122, 1);
}

::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(122, 122, 122, 0.5);
}



// Titlebar
.window-titlebar {
    box-sizing: border-box;
    width: calc(100% - 2px);
    padding: 0 0px;
    overflow: hidden;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    user-select: none;
    zoom: 1;
    line-height: 22px;
    height: 30px;
    display: flex;
    position: fixed;
    top: 1px;
    left: 1px;
    z-index: 100;

    @media (max-width: 700px) {
        background: var(--page-background);
    }

    .appIcon {
        width: 16px;
        height: 16px;
        background: url('../../src/assets/logo.png') center center no-repeat;
        background-size: contain;
        margin-right: 10px;
    }

    .titlebar-drag-region {
        top: 0;
        left: 0;
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: -1;
        -webkit-app-region: drag
    }

    .window-title {
        font-size: 12px;
        padding: 0 10px;
        display: flex;
        align-items: center;
    }

    .window-controls-container {

        display: flex;
        flex-grow: 0;
        flex-shrink: 0;
        text-align: center;
        position: relative;
        z-index: 3000;
        -webkit-app-region: no-drag;
        height: 100%;
        width: 138px;
        margin-left: auto;


        .window-icon-bg {
            display: inline-block;
            -webkit-app-region: no-drag;
            height: 100%;
            width: 33.34%;

            &:hover .window-icon {
                background: var(--titlebar-icon-hover);
            }

            &:hover {
                background-color: rgba(122, 122, 122, .2)
            }
        }

        .window-icon {
            background: var(--titlebar-icon);
            height: 100%;
            width: 100%;
            -webkit-mask-size: 23.1%;
            -webkit-mask-size: 10px;
        }

        .window-close {
            -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.279 5.5L11 10.221l-.779.779L5.5 6.279.779 11 0 10.221 4.721 5.5 0 .779.779 0 5.5 4.721 10.221 0 11 .779 6.279 5.5z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%
        }

        .window-unmaximize {
            -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 8.798H8.798V11H0V2.202h2.202V0H11v8.798zm-3.298-5.5h-6.6v6.6h6.6v-6.6zM9.9 1.1H3.298v1.101h5.5v5.5h1.1v-6.6z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%
        }

        .window-maximize {
            -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 0v11H0V0h11zM9.899 1.101H1.1V9.9h8.8V1.1z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%
        }

        .window-minimize {
            -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg width='11' height='11' viewBox='0 0 11 11' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 4.399V5.5H0V4.399h11z' fill='%23000'/%3E%3C/svg%3E") no-repeat 50% 50%
        }

        .window-icon-bg.window-close-bg:hover {
            background-color: rgba(232, 17, 35, .9)
        }

        .window-icon.window-close:hover {
            background-color: #fff !important;
        }



    }

}

.window-base-inner {
    display: flex;
}


select,
input {
    -webkit-appearance: none;
    background: var(--page-background);
    color: var(--tray-text);
    border: 2px solid var(--input-border);
    outline: none;
    padding: 8px;
    line-height: 1.3;
    font-size: 14px;
    font-family: 'Segoe UI Variable Text', 'Segoe UI';;
    font-weight: 400;
    margin-top: 10px;
    margin-bottom: 15px;

    &:hover {
        border-color: var(--input-border-hover);
    }

    &:active {
        background: var(--input-active-background);
    }
}

input[type="text"] {
    min-width: 235px;
}

input[type="checkbox"] {
    width: 50px;
    padding: 3px;
    border-radius: 20px;

    &:before {
        content: '';
        display: block;
        width: 12px;
        height: 12px;
        border-radius: 10px;
        background: var(--input-border-hover);
        transform: translateX(0px);
        transition: transform 0.166s;
    }

    &[data-checked="true"] {
        background: var(--system-accent-color);
        border-color: var(--system-accent-color);

        &:before {
            background: white;
            transform: translateX(28px);
        }
    }
}

input[type="time"] {
    padding: 5px 5px 5px 10px;
    line-height: 1;
}



label {
    font-size: 14px;
    display: block;

    &+p {
        margin-top: 2px;
    }
}



.sectionTitle {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 20px;
    line-height: 1;
}

.sectionSubtitle {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1;
    display: flex;

    .icon {
        font-size: 22px;
        font-weight: 400;
        margin-top: -1px;
    }

    div+div {
        margin-left: 10px;
    }
}

.pageSection {
    padding-bottom: 40px;
    max-width: 800px;

    &[data-active] {
        display: none;
    }

    &[data-active="true"] {
        display: block;
    }

    &.debug {
        user-select: text;
    }
}

.monitorItem {
    max-width: 320px;
    animation: sliderFadeIn 0.4s;

    @keyframes sliderFadeIn {
        0% {
            opacity: 0;
        }

        33% {
            opacity: 0;
        }

        100% {
            opacity: 1;
        }
    }
}

.adjustmentTimes {
    padding-top: 5px;

    .item {
        padding-top: 20px;
        margin-top: 20px;
        border-top: 1px solid var(--page-text-mid);

        .monitor-item {
            max-width: 320px;
        }

        &+.item {}
    }

    select {
        margin-right: 4px;
    }
}

p {
    font-size: 14px;
    color: var(--page-text-mid);

    b,
    strong {
        color: var(--page-text);
    }
}

a {
    text-decoration: underline;
    cursor: pointer;
    color: var(--page-text);

    &:hover {
        color: var(--page-text-mid);
    }
}


.icon {
    font-family: "Segoe MDL2 Assets";

    &.red {
        color: red;
    }

    &.green {
        color: green;
    }

    &.vfix {
        display: inline-block;
        position: relative;
        top: 2px;
    }
}


.button {
    background: var(--window-border);
    border: 2px solid var(--window-border);
    line-height: 0;
    padding: 6px 12px;
    margin-top: 10px;
    display: inline;
    font-size: 14px;
    text-decoration: none;

    &:hover {
        border-color: var(--input-border);
    }
}


.reorderList {
    max-width: 360px;
    border: 1px solid var(--window-border);

    .sectionSubtitle {
        padding: 15px;
        margin: 0;
    }

    .no-displays-message {
        margin: 10px 12px -10px 12px;
    }
}

.changelog {
    white-space: pre-wrap;
    padding: 10px 20px 20px;
    margin: 20px 0 5px;
    border-top: 1px solid var(--page-text-mid);
    border-bottom: 1px solid var(--page-text-mid);
    line-height: 0;

    p,
    h1,
    h2,
    h3,
    h4,
    h5,
    ul,
    ol {
        line-height: 1.4;
    }
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 5px;
    max-width: 320px;
    background: var(--window-border);

    &>div {
        position: absolute;
        top: 0;
        left: 0;
        width: 0%;
        height: 100%;
        background: var(--system-accent-color);
    }
}


.icons-row {
    display: flex;
    margin: 3px -5px;
}

.icon-option {
    margin: 5px;
    cursor: pointer;
    user-select: none;

    img {
        width: 32px;
        padding: 10px;
        background: #333;
        border: 2px solid #333;
    }

    &[data-active="true"] {
        img {
            background: var(--system-accent-medium);
            border-color: var(--system-accent-medium-dark);
        }
    }
}


.hotkey-monitors {

    .hotkey-item {
        margin-top: 30px;
    }

    .name {}

    .row {
        display: flex;
        justify-content: end;
        align-items: center;
        line-height: 1;

        &>* {
            margin-right: 5px;
        }

    }

    .title {}

    input[type="text"] {
        padding: 6px;
        font-size: 14px;
        height: auto;
        box-sizing: border-box;
        line-height: 1;

        &:focus {
            border-color: var(--system-accent-color);
        }
    }

    input[type="button"] {
        @extend .button;
        padding: 8px;
        line-height: 1;
    }
}


// Sidebar
#sidebar {
    position: relative;
    top: -30px;
    left: 0px;
    width: 300px;
    padding-top: 30px;
    height: calc(100vh - 2px - 30px);
    background: var(--tray-background-base);
    transition: width 0.2s;
    overflow: hidden;
    z-index: 3;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;

    .item {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-items: end;
        align-items: center;
        padding: 13px;
        box-sizing: border-box;
        line-height: 1;

        &[data-type="debug"] {
            margin-top: auto;

            .icon {
                opacity: 0.1;
            }

            .label {
                opacity: 0;
            }

            &[data-active="true"] {

                .icon,
                .label {
                    opacity: 1;
                }
            }
        }

        .icon {
            padding-right: 13px;
            font-size: 18px;
            opacity: 1;
            transition: opacity 0.2s;
        }

        .label {
            margin-top: -2px;
            font-size: 14px;
            opacity: 1;
            transition: opacity 0.2s;
            white-space: pre;
        }

        &:hover {
            background: var(--tray-border);
        }

        &:active {}

        &:before {
            content: ' ';
            width: 4px;
            min-width: 4px;
            height: 23px;
            display: block;
            position: relative;
            left: -13px;
            transform-origin: 0 50%;
            transform: scaleX(0);
            background: var(--system-accent-color);
            transition: transform 0.2s;
        }

        &[data-active='true'] {
            &:before {
                transform: scaleX(1);
            }
        }
    }

    @media (max-width: 700px) {
        width: $sidebarWidthSmall;

        .item {
            &:before {
                margin-right: -4px;
            }

            .label {
                opacity: 0;
            }
        }
    }
}

body[data-transparent=true][data-acrylic=true] .window-base #sidebar {
    //--tray-background: var(--tray-background-blur) !important;
    background: none !important;
}



// Sun Valley tweaks
body[data-fluent-icons="true"] {
    .window-titlebar .window-controls-container {
        .window-close {
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M5.5,6.28.94,10.84A.53.53,0,0,1,.55,11a.51.51,0,0,1-.39-.16A.51.51,0,0,1,0,10.45a.53.53,0,0,1,.16-.39L4.72,5.5.16.94A.53.53,0,0,1,0,.55.54.54,0,0,1,0,.33.66.66,0,0,1,.16.16.57.57,0,0,1,.34,0,.52.52,0,0,1,.55,0,.53.53,0,0,1,.94.16L5.5,4.72,10.06.16A.53.53,0,0,1,10.45,0a.46.46,0,0,1,.21,0,.55.55,0,0,1,.3.3.46.46,0,0,1,0,.21.53.53,0,0,1-.16.39L6.28,5.5l4.56,4.56a.53.53,0,0,1,.16.39.52.52,0,0,1,0,.21.57.57,0,0,1-.12.18.52.52,0,0,1-.17.12.54.54,0,0,1-.22,0,.53.53,0,0,1-.39-.16Z'/%3E%3C/svg%3E") no-repeat 50% 50%
        }
        .window-unmaximize {
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M1.62,11A1.5,1.5,0,0,1,1,10.87a1.68,1.68,0,0,1-.51-.36A1.68,1.68,0,0,1,.13,10,1.5,1.5,0,0,1,0,9.38V3.82A1.5,1.5,0,0,1,.13,3.2a1.82,1.82,0,0,1,.36-.51A1.68,1.68,0,0,1,1,2.33a1.64,1.64,0,0,1,.62-.13H7.18a1.68,1.68,0,0,1,.62.13,1.57,1.57,0,0,1,.51.36,1.57,1.57,0,0,1,.36.51,1.68,1.68,0,0,1,.13.62V9.38a1.64,1.64,0,0,1-.13.62,1.68,1.68,0,0,1-.36.51,1.82,1.82,0,0,1-.51.36,1.5,1.5,0,0,1-.62.13ZM7.15,9.9a.78.78,0,0,0,.21,0,.55.55,0,0,0,.3-.3.46.46,0,0,0,0-.21V3.85a.49.49,0,0,0,0-.21.55.55,0,0,0-.3-.3.49.49,0,0,0-.21,0H1.65a.46.46,0,0,0-.21,0,.55.55,0,0,0-.3.3.78.78,0,0,0,0,.21v5.5a.65.65,0,0,0,0,.21.55.55,0,0,0,.3.3.65.65,0,0,0,.21,0ZM9.9,3.26a2,2,0,0,0-.18-.84A2.21,2.21,0,0,0,8.54,1.27,2.21,2.21,0,0,0,7.7,1.1H2.29A1.66,1.66,0,0,1,2.54.65,1.66,1.66,0,0,1,2.89.3,1.57,1.57,0,0,1,3.34.08,1.81,1.81,0,0,1,3.85,0H7.7A3.25,3.25,0,0,1,9,.26,3.3,3.3,0,0,1,10,1a3.15,3.15,0,0,1,.71,1A3.3,3.3,0,0,1,11,3.3V7.15a1.81,1.81,0,0,1-.08.51,1.57,1.57,0,0,1-.22.45,1.82,1.82,0,0,1-.8.6Z'/%3E%3C/svg%3E") no-repeat 50% 50%
        }
        .window-maximize {
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M1.62,11A1.5,1.5,0,0,1,1,10.87a1.68,1.68,0,0,1-.51-.36A1.68,1.68,0,0,1,.13,10,1.5,1.5,0,0,1,0,9.38V1.62A1.5,1.5,0,0,1,.13,1,1.68,1.68,0,0,1,.49.49,1.68,1.68,0,0,1,1,.13,1.5,1.5,0,0,1,1.62,0H9.38A1.5,1.5,0,0,1,10,.13a1.68,1.68,0,0,1,.51.36,1.68,1.68,0,0,1,.36.51,1.5,1.5,0,0,1,.13.62V9.38a1.5,1.5,0,0,1-.13.62,1.84,1.84,0,0,1-.87.87,1.5,1.5,0,0,1-.62.13ZM9.35,9.9a.65.65,0,0,0,.21,0,.55.55,0,0,0,.3-.3.65.65,0,0,0,0-.21V1.65a.65.65,0,0,0,0-.21.55.55,0,0,0-.3-.3.65.65,0,0,0-.21,0H1.65a.65.65,0,0,0-.21,0,.55.55,0,0,0-.3.3.65.65,0,0,0,0,.21v7.7a.65.65,0,0,0,0,.21.55.55,0,0,0,.3.3.65.65,0,0,0,.21,0Z'/%3E%3C/svg%3E") no-repeat 50% 50%
        }
        .window-minimize {
            -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 11 11'%3E%3Cpath d='M.55,5.5a.46.46,0,0,1-.21,0,.55.55,0,0,1-.3-.3A.46.46,0,0,1,0,5a.52.52,0,0,1,0-.21.71.71,0,0,1,.12-.18.57.57,0,0,1,.18-.12.46.46,0,0,1,.21,0h9.9a.46.46,0,0,1,.21,0,.57.57,0,0,1,.18.12.71.71,0,0,1,.12.18A.52.52,0,0,1,11,5a.46.46,0,0,1,0,.21.55.55,0,0,1-.3.3.46.46,0,0,1-.21,0Z'/%3E%3C/svg%3E") no-repeat 50% 50%
        }
    }
    .icon {
        font-family: "Segoe Fluent Icons", "Segoe MDL2 Assets";
    }
}
body[data-segoe-u-i-variable="true"] {
    .window-titlebar .window-title {
        font-family: "Segoe UI Variable Small", "Segoe UI";
        font-weight: 300;
        font-size: 10.5px;
    }
    #sidebar .item .label {
        font-family: "Segoe UI Variable Small", "Segoe UI";
        font-size: 12.5px;
        font-weight: 300;
    }
    .sectionTitle {
        font-weight: 350;
        font-family: "Segoe UI Variable Display", "Segoe UI";
        font-size: 27.5px;
    }
}